package com.cn.controller;

import com.cn.producer.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author jiangwang
 * @Created by 2020/12/23 14:38
 * @Description: TODO
 */
@RestController
public class SendController
{
    @Autowired
    private MessageProducer producer;

    @GetMapping(value = "/sendMsg/{message}")
    public void sendMsg(@PathVariable("message") String msg)
    {
        producer.send(msg);
    }
}
